/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package linecreator;


import java.awt.Point;
import java.util.ArrayList;

/**
 *
 * @author Marko
 */
public class LineCreatorClass {
    Point topLeft;
    Point bottomRight;
    Point absoluteTopLeft;

    boolean configuring;
    int numOfConfigured;

    boolean creatingLine;
    ArrayList<Point> points;

    int width;
    int height;

    

    public LineCreatorClass() {
        this(null, null, false);
    }

    public LineCreatorClass(Point topLeft, Point bottomRight, boolean configuring) {
        this.topLeft = topLeft;
        this.bottomRight = bottomRight;
        this.configuring = configuring;
        numOfConfigured=0;
        creatingLine=false;
        points = new ArrayList<Point>();
    }

    public void setBottomRight(Point bottomRight) {
        this.bottomRight = bottomRight;
        numOfConfigured= (numOfConfigured+1)%2;

        width = (int) Math.abs(bottomRight.getX() - topLeft.getX());
        height = (int) Math.abs(bottomRight.getY() - topLeft.getY());
    }

    public void setTopLeft(Point topLeft) {
        this.topLeft = topLeft;
        numOfConfigured= (numOfConfigured+1)%2;
    }

    public Point getBottomRight() {
        return bottomRight;
    }

    public Point getTopLeft() {
        return topLeft;
    }
    

    public void setConfiguring(boolean configuring) {
        this.configuring = configuring;
    }

    public boolean isConfiguring() {
        return configuring;
    }

    public Point getAbsoluteTopLeft() {
        return absoluteTopLeft;
    }

    public void setAbsoluteTopLeft(Point absoluteTopLeft) {
        this.absoluteTopLeft = absoluteTopLeft;
    }

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public int getNumOfConfigured() {
        return numOfConfigured;
    }

    public ArrayList<Point> getPoints() {
        return points;
    }

}
